package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ActivityProcessMapper;
import com.ruoyi.system.domain.ActivityProcess;
import com.ruoyi.system.service.IActivityProcessService;
import com.ruoyi.common.core.text.Convert;

/**
 * 活动流程Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-12
 */
@Service
public class ActivityProcessServiceImpl implements IActivityProcessService 
{
    @Autowired
    private ActivityProcessMapper activityProcessMapper;

    /**
     * 查询活动流程
     * 
     * @param id 活动流程主键
     * @return 活动流程
     */
    @Override
    public ActivityProcess selectActivityProcessById(String id)
    {
        return activityProcessMapper.selectActivityProcessById(id);
    }

    /**
     * 查询活动流程列表
     * 
     * @param activityProcess 活动流程
     * @return 活动流程
     */
    @Override
    public List<ActivityProcess> selectActivityProcessList(ActivityProcess activityProcess)
    {
        return activityProcessMapper.selectActivityProcessList(activityProcess);
    }

    /**
     * 新增活动流程
     * 
     * @param activityProcess 活动流程
     * @return 结果
     */
    @Override
    public int insertActivityProcess(ActivityProcess activityProcess)
    {
        activityProcess.setCreateTime(DateUtils.getNowDate());
        return activityProcessMapper.insertActivityProcess(activityProcess);
    }

    /**
     * 修改活动流程
     * 
     * @param activityProcess 活动流程
     * @return 结果
     */
    @Override
    public int updateActivityProcess(ActivityProcess activityProcess)
    {
        activityProcess.setUpdateTime(DateUtils.getNowDate());
        return activityProcessMapper.updateActivityProcess(activityProcess);
    }

    /**
     * 批量删除活动流程
     * 
     * @param ids 需要删除的活动流程主键
     * @return 结果
     */
    @Override
    public int deleteActivityProcessByIds(String ids)
    {
        return activityProcessMapper.deleteActivityProcessByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除活动流程信息
     * 
     * @param id 活动流程主键
     * @return 结果
     */
    @Override
    public int deleteActivityProcessById(String id)
    {
        return activityProcessMapper.deleteActivityProcessById(id);
    }
}
